<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>qspips: xqspips_dual_flash_lqspi_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">qspips
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xqspips__dual__flash__lqspi__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xqspips_dual_flash_lqspi_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the QSPI driver (<a class="el" href="struct_x_qspi_ps.html" title="The XQspiPs driver instance data. ">XQspiPs</a>) in Linear QSPI mode, with two serial FLASH devices on separate buses. </p>
<p>With two flash memories on separate buses, even numbered bits in data words are written to the lower memory and odd numbered bits are written to the upper memory. This example writes to the two flash memories in QSPI mode and reads the data back from the flash memories, in Linear QSPI mode. It is recommended to use Manual CS + Auto start for best performance.</p>
<p>The hardware which this example runs on, must have a serial FLASH (Numonyx N25Q, Winbond W25Q, Spansion S25FL, ISSI IS25WP) for it to run. This example has been tested with the Numonyx Serial Flash (N25Q128) and IS25WP series flash parts.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>None.</p>
<pre>
 MODIFICATION HISTORY:</pre><pre> Ver   Who Date     Changes
</p>
<hr/>
<p>
 1.00  sdm 11/25/10 First release
 2.00a  kka 22/08/12 Updated the example as XQspiPs_PolledTransfer API has
                     changed. Changed the prescalar to use divide by 8.
                     The user can change the prescalar to a maximum of
                     divide by 2 based on the reference clock in the
                     system.
                     Set the Holdb_dr bit in the configuration register using
                     XQSPIPS_HOLD_B_DRIVE_OPTION. Setting this bit
                     drives the HOLD bit of the QSPI controller.
                     This is required for QSPI to be used in Non QSPI boot
                     mode else there needs to be an external pullup on this
                     line.
       ms  04/05/17 Modified Comment lines in functions to
                    recognize it as documentation block for doxygen
                    generation.
 3.5    tjs 07/16/18 Added support for low density ISSI flash parts.
                     Added FlashQuadEnable API to enable quad mode in flash.
                     Added FlashReadID API to read and identify the flash.
 3.6   akm 04/15/19 Modified FlashQuadEnable, FlashWrie and FlashErase APIs,
                     to wait for the on going operation to complete before
                     performing the next operation.
 3.10  akm 08/17/22 Fix logical error in NumSect calculation.
 3.11  akm 07/10/23 Add support for system device-tree flow for example.
 3.14  sb  03/25/25 Fixed gcc and g++ warnings.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1cb26e7de1e53fe8bd6c4e1d3a9e8ecc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a1cb26e7de1e53fe8bd6c4e1d3a9e8ecc">FlashErase</a> (<a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *QspiPtr, u32 Address, u32 ByteCount)</td></tr>
<tr class="memdesc:a1cb26e7de1e53fe8bd6c4e1d3a9e8ecc"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function erases the sectors in the serial FLASH connected to the QSPI interface.  <a href="#a1cb26e7de1e53fe8bd6c4e1d3a9e8ecc">More...</a><br/></td></tr>
<tr class="separator:a1cb26e7de1e53fe8bd6c4e1d3a9e8ecc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4691616d85f33bb068a7e9740249b86"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#aa4691616d85f33bb068a7e9740249b86">FlashWrite</a> (<a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *QspiPtr, u32 Address, u32 ByteCount, u8 Command)</td></tr>
<tr class="memdesc:aa4691616d85f33bb068a7e9740249b86"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function writes to the serial FLASH connected to the QSPI interface.  <a href="#aa4691616d85f33bb068a7e9740249b86">More...</a><br/></td></tr>
<tr class="separator:aa4691616d85f33bb068a7e9740249b86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af28c30bb35e57c70a8b73c8796fb3fb1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#af28c30bb35e57c70a8b73c8796fb3fb1">FlashRead</a> (<a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *QspiPtr, u32 Address, u32 ByteCount, u8 Command)</td></tr>
<tr class="memdesc:af28c30bb35e57c70a8b73c8796fb3fb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads from the serial FLASH connected to the QSPI interface.  <a href="#af28c30bb35e57c70a8b73c8796fb3fb1">More...</a><br/></td></tr>
<tr class="separator:af28c30bb35e57c70a8b73c8796fb3fb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa424c9f6fee5f08746f8f3233b7467ed"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#aa424c9f6fee5f08746f8f3233b7467ed">FlashReadID</a> (void)</td></tr>
<tr class="memdesc:aa424c9f6fee5f08746f8f3233b7467ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads serial FLASH ID connected to the SPI interface.  <a href="#aa424c9f6fee5f08746f8f3233b7467ed">More...</a><br/></td></tr>
<tr class="separator:aa424c9f6fee5f08746f8f3233b7467ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6682571380b6d4dee70c0db72199278c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a6682571380b6d4dee70c0db72199278c">FlashQuadEnable</a> (<a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *QspiPtr)</td></tr>
<tr class="memdesc:a6682571380b6d4dee70c0db72199278c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function enables quad mode in the serial flash connected to the SPI interface.  <a href="#a6682571380b6d4dee70c0db72199278c">More...</a><br/></td></tr>
<tr class="separator:a6682571380b6d4dee70c0db72199278c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7715e559a0225cb169e53054c65d3b8c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a7715e559a0225cb169e53054c65d3b8c">LinearQspiFlashExample</a> (<a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *QspiInstancePtr, u16 QspiDeviceId)</td></tr>
<tr class="memdesc:a7715e559a0225cb169e53054c65d3b8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The purpose of this function is to illustrate how to use the <a class="el" href="struct_x_qspi_ps.html" title="The XQspiPs driver instance data. ">XQspiPs</a> device driver in Linear mode.  <a href="#a7715e559a0225cb169e53054c65d3b8c">More...</a><br/></td></tr>
<tr class="separator:a7715e559a0225cb169e53054c65d3b8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to call the QSPI Flash example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a1cb26e7de1e53fe8bd6c4e1d3a9e8ecc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FlashErase </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *&#160;</td>
          <td class="paramname"><em>QspiPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>ByteCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function erases the sectors in the serial FLASH connected to the QSPI interface. </p>
<p>This function erases the sectors in the serial Flash connected to the QSPI interface.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">QspiPtr</td><td>is a pointer to the QSPI driver component to use. </td></tr>
    <tr><td class="paramname">Address</td><td>contains the address of the first sector which needs to be erased. </td></tr>
    <tr><td class="paramname">ByteCount</td><td>contains the total size to be erased.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="group__qspips.html#ga92bcb2ff87e82a4f27e9a49db023d08d">XQspiPs_PolledTransfer()</a>.</p>

<p>Referenced by <a class="el" href="xqspips__dual__flash__stack__lqspi__example_8c.html#a5c580a6457349e06736a6f1e065e3c6e">DualStackExample()</a>, <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a7715e559a0225cb169e53054c65d3b8c">LinearQspiFlashExample()</a>, <a class="el" href="xqspips__flash__intr__example_8c.html#ae19ad8425b4f3fc636a7752ef1919694">QspiFlashIntrExample()</a>, <a class="el" href="xqspips__flash__polled__example_8c.html#a716abd44c4ecfd53189130fa9a73b731">QspiFlashPolledExample()</a>, and <a class="el" href="xqspips__g128__flash__example_8c.html#a124f20a4738c2c9c86d92590dab986e3">QspiG128FlashExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a6682571380b6d4dee70c0db72199278c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FlashQuadEnable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *&#160;</td>
          <td class="paramname"><em>QspiPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function enables quad mode in the serial flash connected to the SPI interface. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">QspiPtr</td><td>is a pointer to the QSPI driver component to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="group__qspips.html#ga92bcb2ff87e82a4f27e9a49db023d08d">XQspiPs_PolledTransfer()</a>.</p>

<p>Referenced by <a class="el" href="xqspips__dual__flash__stack__lqspi__example_8c.html#a5c580a6457349e06736a6f1e065e3c6e">DualStackExample()</a>, <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a7715e559a0225cb169e53054c65d3b8c">LinearQspiFlashExample()</a>, <a class="el" href="xqspips__flash__intr__example_8c.html#ae19ad8425b4f3fc636a7752ef1919694">QspiFlashIntrExample()</a>, and <a class="el" href="xqspips__flash__polled__example_8c.html#a716abd44c4ecfd53189130fa9a73b731">QspiFlashPolledExample()</a>.</p>

</div>
</div>
<a class="anchor" id="af28c30bb35e57c70a8b73c8796fb3fb1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FlashRead </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *&#160;</td>
          <td class="paramname"><em>QspiPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>ByteCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Command</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads from the serial FLASH connected to the QSPI interface. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">QspiPtr</td><td>is a pointer to the QSPI driver component to use. </td></tr>
    <tr><td class="paramname">Address</td><td>contains the address to read data from in the FLASH. </td></tr>
    <tr><td class="paramname">ByteCount</td><td>contains the number of bytes to read. </td></tr>
    <tr><td class="paramname">Command</td><td>is the command used to read data from the flash. QSPI device supports one of the Read, Fast Read, Dual Read and Fast Read commands to read data from the flash.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="group__qspips.html#gaeafbee8d795ef8805ab7c8756f5e2274">XQspiPs_Transfer()</a>.</p>

<p>Referenced by <a class="el" href="xqspips__flash__intr__example_8c.html#ae19ad8425b4f3fc636a7752ef1919694">QspiFlashIntrExample()</a>, <a class="el" href="xqspips__flash__polled__example_8c.html#a716abd44c4ecfd53189130fa9a73b731">QspiFlashPolledExample()</a>, and <a class="el" href="xqspips__g128__flash__example_8c.html#a124f20a4738c2c9c86d92590dab986e3">QspiG128FlashExample()</a>.</p>

</div>
</div>
<a class="anchor" id="aa424c9f6fee5f08746f8f3233b7467ed"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int FlashReadID </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads serial FLASH ID connected to the SPI interface. </p>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if read id, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="group__qspips.html#ga92bcb2ff87e82a4f27e9a49db023d08d">XQspiPs_PolledTransfer()</a>.</p>

<p>Referenced by <a class="el" href="xqspips__dual__flash__stack__lqspi__example_8c.html#a5c580a6457349e06736a6f1e065e3c6e">DualStackExample()</a>, <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a7715e559a0225cb169e53054c65d3b8c">LinearQspiFlashExample()</a>, <a class="el" href="xqspips__flash__intr__example_8c.html#ae19ad8425b4f3fc636a7752ef1919694">QspiFlashIntrExample()</a>, <a class="el" href="xqspips__flash__polled__example_8c.html#a716abd44c4ecfd53189130fa9a73b731">QspiFlashPolledExample()</a>, and <a class="el" href="xqspips__g128__flash__example_8c.html#a124f20a4738c2c9c86d92590dab986e3">QspiG128FlashExample()</a>.</p>

</div>
</div>
<a class="anchor" id="aa4691616d85f33bb068a7e9740249b86"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FlashWrite </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *&#160;</td>
          <td class="paramname"><em>QspiPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>ByteCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Command</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function writes to the serial FLASH connected to the QSPI interface. </p>
<p>This function writes to the serial Flash connected to the QSPI interface.</p>
<p>All the data put into the buffer must be in the same page of the device with page boundaries being on 256 byte boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">QspiPtr</td><td>is a pointer to the QSPI driver component to use. </td></tr>
    <tr><td class="paramname">Address</td><td>contains the address to write data to in the FLASH. </td></tr>
    <tr><td class="paramname">ByteCount</td><td>contains the number of bytes to write. </td></tr>
    <tr><td class="paramname">Command</td><td>is the command used to write data to the flash. QSPI device supports only Page Program command to write data to the flash.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None.</dd></dl>
<p>All the data put into the buffer must be in the same page of the device with page boundaries being on 256 byte boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">QspiPtr</td><td>is a pointer to the QSPI driver component to use. </td></tr>
    <tr><td class="paramname">Address</td><td>contains the address to write data to in the Flash. </td></tr>
    <tr><td class="paramname">ByteCount</td><td>contains the number of bytes to write. </td></tr>
    <tr><td class="paramname">Command</td><td>is the command used to write data to the flash. QSPI device supports only Page Program command to write data to the flash.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="group__qspips.html#ga92bcb2ff87e82a4f27e9a49db023d08d">XQspiPs_PolledTransfer()</a>.</p>

<p>Referenced by <a class="el" href="xqspips__dual__flash__stack__lqspi__example_8c.html#a5c580a6457349e06736a6f1e065e3c6e">DualStackExample()</a>, <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a7715e559a0225cb169e53054c65d3b8c">LinearQspiFlashExample()</a>, <a class="el" href="xqspips__flash__intr__example_8c.html#ae19ad8425b4f3fc636a7752ef1919694">QspiFlashIntrExample()</a>, <a class="el" href="xqspips__flash__polled__example_8c.html#a716abd44c4ecfd53189130fa9a73b731">QspiFlashPolledExample()</a>, and <a class="el" href="xqspips__g128__flash__example_8c.html#a124f20a4738c2c9c86d92590dab986e3">QspiG128FlashExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a7715e559a0225cb169e53054c65d3b8c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LinearQspiFlashExample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_qspi_ps.html">XQspiPs</a> *&#160;</td>
          <td class="paramname"><em>QspiInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>QspiDeviceId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The purpose of this function is to illustrate how to use the <a class="el" href="struct_x_qspi_ps.html" title="The XQspiPs driver instance data. ">XQspiPs</a> device driver in Linear mode. </p>
<p>This function writes data to the serial FLASH in QSPI mode and reads data in Linear QSPI mode.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">QspiInstancePtr</td><td>is a pointer to the QSPIPS driver to use. </td></tr>
    <tr><td class="paramname">QspiDeviceId</td><td>is the XPAR_&lt;QSPIPS_instance&gt;_DEVICE_ID value from xparameters.h</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, else XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None.</dd></dl>
<p>This function writes data to the serial FLASH in QSPI mode and reads data in Linear QSPI mode.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">QspiInstancePtr</td><td>is a pointer to the QSPIPS driver to use. </td></tr>
    <tr><td class="paramname">QspiDeviceId</td><td>is the XPAR_&lt;QSPIPS_instance&gt;_DEVICE_ID value from xparameters.h.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, else XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_qspi_ps___config.html#a26d9a68f7ad821671044d35e5e8a851e">XQspiPs_Config::BaseAddress</a>, <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a1cb26e7de1e53fe8bd6c4e1d3a9e8ecc">FlashErase()</a>, <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a6682571380b6d4dee70c0db72199278c">FlashQuadEnable()</a>, <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#aa424c9f6fee5f08746f8f3233b7467ed">FlashReadID()</a>, <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#aa4691616d85f33bb068a7e9740249b86">FlashWrite()</a>, <a class="el" href="group__qspips.html#gaf348b6ee07c1e3e7d01857a789e658d4">XQspiPs_CfgInitialize()</a>, <a class="el" href="group__qspips.html#ga79d211f4165bfe188163de14f9b6f80b">XQSPIPS_CLK_PRESCALE_8</a>, <a class="el" href="group__qspips.html#ga4c42b31270f32f0dbaecd9d582ed3287">XQSPIPS_FORCE_SSELECT_OPTION</a>, <a class="el" href="group__qspips.html#ga272d8eb4928d9c3da9eaad379e7bd5a9">XQSPIPS_HOLD_B_DRIVE_OPTION</a>, <a class="el" href="group__qspips.html#ga3f4fa51f1ba6d49a6ec9e9b079fc4fd7">XQspiPs_LookupConfig()</a>, <a class="el" href="group__qspips.html#ga0b0c2444343441f2bd006f8f0971369b">XQSPIPS_LQSPI_MODE_OPTION</a>, <a class="el" href="group__qspips.html#gacbdefc29998bb7b4a61e62f8ef3ed127">XQspiPs_LqspiRead()</a>, <a class="el" href="group__qspips.html#gab11b1e374c5ed9fbfc9ac9e81cad3e3e">XQSPIPS_MANUAL_START_OPTION</a>, <a class="el" href="group__qspips.html#ga0975016f42a8249235098408ab0c9da6">XQspiPs_SelfTest()</a>, <a class="el" href="group__qspips.html#gaafc1b751d17216ad037b7dd167f073f0">XQspiPs_SetClkPrescaler()</a>, <a class="el" href="group__qspips.html#ga3d5c1b501b5dc6e14297682279bbfee2">XQspiPs_SetLqspiConfigReg</a>, <a class="el" href="group__qspips.html#ga425ce03f19417a386c6882efb79641df">XQspiPs_SetOptions()</a>, and <a class="el" href="group__qspips.html#ga8eb7e89e789b707718444125358167e9">XQspiPs_SetSlaveSelect()</a>.</p>

<p>Referenced by <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to call the QSPI Flash example. </p>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="xqspips__dual__flash__lqspi__example_8c.html#a7715e559a0225cb169e53054c65d3b8c">LinearQspiFlashExample()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
